<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>员工列表</title>
    <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/bootcdn/BootCDN/ajax/libs/bootstrap/3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="<%=path%>/hplus/css/font-awesome.min93e3.css?v=4.4.0"/>
    <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/datatables/1.10.16/css/jquery.dataTables.min.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="<%=path%>/hplus/css/plugins/datapicker/datepicker3.css">
    <link rel="stylesheet" type="text/css" href="<%=path%>/hplus/css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css">
    <link rel="stylesheet" type="text/css" href="<%=path%>/hplus/css/plugins/chosen/chosen.css"/>
    <link rel="stylesheet" type="text/css" href="<%=path%>/hplus/css/style.min.css"/>
    <link href="<%=path%>/hplus/js/plugins/sweetalert/sweetalert2.min.css" rel="stylesheet">
    <style type="text/css">
	body{font-size: 14px;}
		.yellow_circle{
		    width: 120px;
		    height: 120px;
		    background: #fee087;
		    border-radius: 50%;
		    padding-top: 30px;
		    margin: 4px;
		}
		.yellow_circle p{
		    color: #333;
		    text-align: center; 
		}
		
		.yellow_circle p.people{
		    color: #8f721c;
		    font-size: 20px;
		}
		
		.yellow_circle_border{            
		    width:130px;
		    height:130px;
		    border:1px solid #fee087;
		    border-radius: 50%;
		    display: inline-block;
		}
		.k_blue {
			border-color: #c9cff5;
		}
		.k_blue .yellow_circle {
		    background: #c9cff5;
		}
		a{color:black;padding: 0 8px;}
		a:hover{color:#1ab394;}
		a.currentNode{color:#1ab394;}
		.radio{margin-top: 0;}
		.radio-primary input[type="radio"] + label::after {background-color: #1ab394;}
		.radio-primary input[type="radio"]:checked + label::after {background-color: #1ab394;}
		.radio-primary input[type="radio"]:checked + label::before {border-color: #1ab394;}
		 .aa{width:100px; height:300px;padding: 60px;margin-right:30px;}
	</style>
</head>
<body class="gray-bg">
	<div class="container-fluid">
	   <div class="row">
	        <div class="col-sm-12" style="height:80px;">
	                <h4><a href="staffList.html" onclick="javascript:location.replace(this.href);event.returnValue=false;">员工列表></a><span id="liename"></span>>员工概况</h4>
	        </div>
	        <div class="couton" style="padding: 10px,0,10px,0,;margin-left:14px">
				<button type="button" class="btn btn-default btn-lg" style="background-color: white;color: black;border:none;" onclick="messagestaff('1')">员工概况</button>
				<button type="button" class="btn btn-info btn-lg"  style="background-color: #F5F5F5;color: black;border:none;" onclick="messagestaff('2')">积分记录</button>      
				<button type="button" class="btn btn-info btn-lg" style="background-color: #F5F5F5;color: black;border:none;" onclick="messagestaff('3')">邀请粉丝</button>      
				<button type="button" class="btn btn-info btn-lg" style="background-color: #F5F5F5;color: black;border:none;" onclick="messagestaff('4')">邀请会员</button>      
			</div>
		</div>
		
	   <div class="row" style="height:340px;background: white;margin:auto" >
				<div class="col-sm-3">
		            <div class="clo-sm-2" style="float:left;">
		            	<img id ="imgHade" style="height:120px;width:120px;margin:80px 40px 0 40px;border-radius:50%;" src="">
		            </div>
		            <div class="clo-sm-1" style="margin-top:120px;margin-left:100px;">
		            	<span id="lie" style="font-weight:bold;font-size:13px;text-align:center;height:80px;"></span>
		            </div>
		       	</div>
				<div class="col-sm-9">
					<div style="float:left;">
					<div class="col-sm-1 aa">
						<div class="yellow_circle_border"><div class="yellow_circle"><p>累计积分</p><p class="people"><span>0</span><br/>分</p></div></div>
					</div>
					<div class="col-sm-2 aa">
						<div class="yellow_circle_border k_blue"><div class="yellow_circle"><p>剩余积分</p><p class="people"><span>0</span><br/>分</p></div></div>
					</div>
					<div class="col-sm-2 aa">
						<div class="yellow_circle_border"><div class="yellow_circle"><p>邀请会员</p><p class="people"><span>0</span><br/>人</p></div></div>
					</div>
					<div class="col-sm-2 aa">
						<div class="yellow_circle_border k_blue"><div class="yellow_circle"><p>邀请粉丝</p><p class="people"><span>0</span><br/>人</p></div></div>
					</div>
					</div>
				</div>
	</div>
	<div class="row" style="border-bottom:1px dashed Black;margin:auto"></div>
	<div class="row" style="height:340px;background: white;margin:auto">
			
				<div class="col-sm-3">
			            <br>
			           		<span></span>
			            <br>
			     </div>
			     
			     <div class="col-sm-9" style="padding: 30px;">
			     	
		           <div class ="col-sm-5 staffweb" id="staffaa">
			           	<p class="staff">注册时间：
			           	<span id="time">0</span>
			           	<p class="staff">OpenId：
			           	<span id="open">0</span>
		           	</div>
		           	<div class ="col-sm-4">
			            <p class="staff">关注时间：
			           	<span id="guzn">0</span>
		           </div>
			     </div>
				
	</div>
</div>
</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/bootcdn/BootCDN/ajax/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/datatables/1.10.16/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="<%=path%>/hplus/js/plugins/datapicker/bootstrap-datepicker.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/artDialog/7.0.0/dialog-plus.js"></script>
<script type="text/javascript" src="<%=path%>/hplus/js/plugins/chosen/chosen.jquery.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.17.0/jquery.validate.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/artDialog/7.0.0/dialog-plus.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
<script src="<%=path%>/hplus/js/plugins/sweetalert/sweetalert2.min.js"></script>
<script type="text/javascript" src="<%=path%>/js/dateUtils.js"></script>
<script type="text/javascript">
var path = "<%=path%>";
var staffId = getUrlParam("id");

$(function(){
	init();
});
/*页面跳转  */
function messagestaff(id){
		var name = $("#liename").text();
		if(id == 1){
			window.location.href="<%=path%>/view/ui/staffdetails?id="+staffId+"&name="+encodeURI(encodeURI(name))
		}else if(id == 2){
			window.location.href="<%=path%>/view/ui/integralrecord?id="+staffId+"&name="+encodeURI(encodeURI(name))
		}else if(id == 3){
			window.location.href="<%=path%>/view/ui/invitingfans?id="+staffId+"&name="+encodeURI(encodeURI(name))
		}else{
			window.location.href="<%=path%>/view/ui/invitingmembers?id="+staffId+"&name="+encodeURI(encodeURI(name))
		}
	}
function init(){
		$.post(path+"/staff/ajaxGetStaff",{id:staffId},function(data){
			if(data.status == "200"){
				var staff = data.data.liststaff;
				var src = data.data.liststaff.headImg;
				$(".people:eq(0)>span").text(staff.historyScore);
				$(".people:eq(1)>span").text(staff.surplusScore);
				$(".people:eq(2)>span").text(staff.memberCount);
				$(".people:eq(3)>span").text(staff.fansCount);
				$("#liename").text(staff.name);
				$("#lie").text(staff.name);
				$("#imgHade").attr("src",src);
				var date = formatDateTimeYMDHMS(staff.focusTime);
				if(staff.createTime != null){
					var datetime = formatDateTimeYMDHMS(staff.createTime);
				}else{
					var datetime ="暂未关注";
				}
				$("#time").text(date);
				$("#guzn").text(datetime);
				$("#open").text(staff.openId);
				var list = data.data.liststaffpropety;
				var html_ = '';
				for (var i = 0; i < list.length; i++) {
					if(list[i].keyName == "name"){
						html_ +='<p class="staff">姓名：<span id="guzn">'+staff.name+'</span>'
					}else if(list[i].keyName == "phone"){
						html_ +='<p class="staff">手机：<span id="guzn">'+staff.phone+'</span>'
					}else if(list[i].keyName == "departmentId"){
						html_ +='<p class="staff">所属部门：<span id="guzn">'+staff.departMentName+'</span>'
					}else if(list[i].keyName == "idCard"){
						html_ +='<p class="staff">身份证号：<span id="guzn">'+staff.idCard+'</span>'
					}else if(list[i].keyName == "birthday"){
						if(staff.birthday == null || staff.birthday == ""){
							var datee = "";	
						}else{
						var datee = formatDateTimeYMDHMS(staff.birthday).substring(0,11);
						}
						html_ +='<p class="staff">出生日期：<span id="guzn">'+datee+'</span>'
					}else if(list[i].keyName == "email"){
						html_ +='<p class="staff">邮箱：<span id="guzn">'+staff.email+'</span>'
					}else if(list[i].keyName == "sex"){
						if(staff.sex == "m"){
							var see = "男";
						}else if(staff.sex == "f"){
							var see = "女";
						}else{
							var see = "未知"
						}
						html_ +='<p class="staff">性别：<span id="guzn">'+see+'</span>'
					}else if(list[i].keyName == "detailAddress"){
						html_ +='<p class="staff">地址：<span id="guzn">'+staff.detailAddress+'</span>'
					}
					
				}
				$("#staffaa").append(html_);
			}else if(data.status == "201"){
				alert("无记录");
			}else{
				alert("远程请求出错");
			}
		},"json");
	}
function getUrlParam(key){
	var reg = new RegExp("(^|&)"+ key +"=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if(r!=null)return  unescape(r[2]); return null;
}	

</script>
</html>